package com.cslg.ac.demo;


import com.cslg.ac.demo.interceptor.EncodingInterceptor;
import com.cslg.ac.demo.interceptor.SessionAuthInteceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
@PropertySource(value={"classpath:chat.properties"}, encoding="utf-8")
@MapperScan(basePackages={"com.cslg.ac.demo.dao"})
public class LovingPetConfig extends WebMvcConfigurerAdapter {

    @Autowired
    EncodingInterceptor encodingInterceptor;
    @Autowired
    SessionAuthInteceptor sessionAuthInteceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(encodingInterceptor);
        registry.addInterceptor(sessionAuthInteceptor);
    }
}

